<?php
/**
 * Created by PhpStorm.
 * User: My pc
 * Date: 2017/1/30/030
 * Time: 16:00
 */
//模板句柄
define('IS_CACHE',false);
global $_tpl,$_cache;
if (IS_CACHE && !$_cache->noCache()) {
    ob_start();
    $_tpl->cache(Tool::tplName().'.tpl');
}
$_nav = new NavAction($_tpl);
$_nav->showfront();  //列出主导航

$_cookie = new Cookie('user');
if (IS_CACHE) {
    $_tpl->assign('header','<script type="text/javascript">getHeader();</script>');
} else {
    if ($_cookie->getCookie()) {
        $_tpl->assign('header',$_cookie->getCookie().'，您好！ <a href="register.php?action=logout">退出</a> ');
    } else {
        $_tpl->assign('header','	<a href="register.php?action=reg" class="user">注册</a> <a href="register.php?action=login" class="user">登录</a>');
    }
}
